Skip to content

Prevent inputs param from being stripped from actions_run_trigger tool schema#2417

Open
kerobbi wants to merge 2 commits intomainfrom
kerobbi/fix-inputs-schema
Open

Prevent inputs param from being stripped from actions_run_trigger tool schema#2417
kerobbi wants to merge 2 commits intomainfrom
kerobbi/fix-inputs-schema

Conversation

@kerobbi
Copy link
Copy Markdown
Contributor

@kerobbi kerobbi commented May 1, 2026

Summary

Adds a properties field to the inputs param schema in actions_run_trigger so it is not dropped from the tool schema due to OAI strict mode schema requirements. Also replaces a silent type assertion with OptionalParam for proper error handling on malformed inputs.

Why

Fixes #1877

The inputs parameter was defined as type: "object" with no properties field, and OAI strict mode requires object types to include a properties field. Without it, the parameter is not visible to GPT models.

What changed

  • Added Properties: map[string]*jsonschema.Schema{} to the inputs param schema
  • Replaced manual type assertion for inputs with OptionalParam[map[string]any], which returns an error on type mismatch instead of silently dropping the value

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed - inputs param now serialises with an empty properties field
  • New tool added

Prompts tested (tool changes only)

  • "Run the X workflow in OWNER/REPO on Y branch with these inputs: FIELD1=value1, ..."
  • "Trigger the X workflow in OWNER/REPO, ref: Y. Pass these workflow inputs: FIELD1=value1, ..."

All testing was done against a mock workflow with optional params - verified across multiple models.

Security / limits

  • No security or limits impact
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Note: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed
  • Updated (README / docs / examples)

Copilot AI review requested due to automatic review settings May 1, 2026 15:47
@kerobbi kerobbi requested a review from a team as a code owner May 1, 2026 15:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes actions_run_trigger schema/argument handling so workflow dispatch inputs are preserved for model/tooling consumers and malformed inputs are surfaced as errors instead of being silently ignored (addresses #1877).

Changes:

  • Add an explicit empty properties map to the inputs JSON schema to prevent it from being stripped during schema processing.
  • Parse inputs via OptionalParam[map[string]any] to return a proper error on type mismatch.
  • Update the tool schema snapshot to reflect the serialized properties: {} addition.
Show a summary per file
File Description
pkg/github/actions.go Ensures inputs remains in the tool schema and adds strict type-checking/error handling when inputs is provided.
pkg/github/toolsnaps/actions_run_trigger.snap Updates the recorded schema snapshot to include inputs.properties: {}.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment thread pkg/github/actions.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invoking run_workflow within actions_run_trigger doesn't recognize inputs field and not passed when triggering workflow

2 participants